package com.bytz.modules.cms.order.util;

import com.bytz.modules.cms.order.constant.OrderConstants;
import com.bytz.modules.cms.order.entity.Order;

import org.apache.commons.lang3.StringUtils;

/**
 * @program: cms-backend
 *
 * @description:
 *
 * @author: KyleWang
 *
 * @create: 2022-11-28 16:50
 **/

public class OrderUtils {

    /**
     * 计算是否需要ec
     * @param order
     * @return
     */
    public static boolean ecRequired(Order order) {
        return StringUtils.equals(order.getEcRequired(), OrderConstants.EcRequired.NECESSARY) ||
                StringUtils.equals(order.getEcRequired(), OrderConstants.EcRequired.OPTIONAL);
    }

}